package cn.pegasus.teamwork.pegasus.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.pegasus.teamwork.pegasus.entity.BussServiceProject;
import cn.pegasus.teamwork.pegasus.entity.BussUserCoupon;
import cn.pegasus.teamwork.pegasus.mapper.BussUserCouponMapper;
import cn.pegasus.teamwork.pegasus.service.BussUserCouponService;
import cn.iyizhan.teamwork.base.service.impl.BaseServiceImpl;
import cn.iyizhan.teamwork.base.util.PageHelper;
import cn.iyizhan.teamwork.base.util.PageObject;

/**
 * @author ryan.bian
 * @version 
 */
@Service("bussUserCouponService")
public class BussUserCouponServiceImpl extends BaseServiceImpl<BussUserCoupon, BussUserCouponMapper> implements BussUserCouponService {
	// 注入当前dao对象
    @Autowired
    private BussUserCouponMapper bussUserCouponMapper;

    public BussUserCouponServiceImpl() {
        setMapperClass(BussUserCouponMapper.class, BussUserCoupon.class);
    }

	@Override
	public PageObject<BussUserCoupon> PageList(Map<String, Object> map) {
		int totalData = bussUserCouponMapper.getTotal(map);
        PageHelper pageHelper = new PageHelper(totalData, map);
        List<BussUserCoupon> list = bussUserCouponMapper.findListByPage(pageHelper.getMap());
        PageObject<BussUserCoupon> pageObject = pageHelper.getPageObject();
        pageObject.setDataList(list);
		return pageObject;
	}
    
 
}
